package com.zhouxiaoge.回调;

/**
 * @author 周明阳
 * mail:gqzmy@outlook.com
 * 时间:2018-05-02 9:57
 */

public class Teacher implements Callback {

    private Student student;

    public Teacher(Student student) {
        this.student = student;
    }

    public void askQuestion() {
        student.resolveQuestion(this);
    }

    @Override
    public void tellAnswer(int answer) {
        System.out.println("知道答案了，是 " + answer);
    }
}
